console.log("main.js")


import './assets/css/common.css'
import './assets/css/index.css'
import './assets/css/style.styl'

// import './assets/img/avatar.png'

import config from './js/config.js'
import util from './js/util'
import axios from 'axios'

import common from './js/common.js'



console.log(config)
console.log(util)
console.log(common)

var a = 2
let b = 3

let c = Math.random(5)

function changeA() {
    a = a + 10
}

console.log("a :", a)
console.log(`b : `, b)
console.log(`c : `, c)
console.log(`a * b = `, a * b)

changeA()
console.log("a :", a)
console.log("changeA ", changeA)
console.clear();

document.getElementById("sendajax").onclick = function () {
    axios.get('api/demo/helloc' + '?name=tom&age=23')
        .then(function (response) {
            console.log(response);
        })
        .catch(function (error) {
            console.log(error);
        });
        
        axios.post('api/demo/form', {
            name: 'Fred',
            age: 20
        })
        .then(function (response) {
            console.log(response);
        })
        .catch(function (error) {
            console.log(error);
        });

    $.ajax({
        url: "api/demo/form",
        //请求方式
        type: "POST",
        dataType: "json", //返回格式为json
        //请求的媒体类型
        contentType: "application/json;charset=UTF-8",
        data: JSON.stringify({ name: "dfgdfsgfg" }),
        success: function (res) {
            console.log(res)
        }
    })
}
